package com.cloud.mkz.admin.api.dto;

import com.cloud.mkz.admin.api.entity.RbacUser;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @author: KuangJianyu
 * @date: 2021-3-22
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class UserBean implements Serializable {
    private String fullName;
    private Timestamp loginTime;
    private String authToken;
    private Map<String, List<String>> permissions;

    public UserBean(RbacUser authedUser, String authToken){
        this.fullName = authedUser.getFullName();
        this.loginTime = authedUser.getLastLoginTime();
        this.authToken = authToken;
    }
}
